<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
        <form action="">
            <p>
                电话号码: <input type="text" name="" v-model="phone" id="">
                <button @click="getPhone">提交</button>
            </p>

            <h3>按键修饰符</h3>
            <input type="text" @keydown.enter="getPhone" v-model="dfsd" name="" id="">
        </form>
    </div>
    <script>
        const app = new Vue({
            el: "#app",
            data: {
                phone: "",
                dfsd: "",
            },
            methods: {
                getPhone() {
                    alert(this.dfsd)
                }
            }
        })
    </script>
</body>

</html>